package com.pkk.penguin.frame.know.java.practice.stack;

import com.pkk.penguin.frame.know.java.practice.stack.impl.StackInter;
import com.pkk.penguin.frame.know.java.practice.stack.impl.array.StackArray;
import com.pkk.penguin.frame.know.java.practice.stack.impl.linkedstack.SinglyLinkedListStack;
import com.pkk.penguin.frame.know.java.practice.stack.impl.listdocker.StackDockerList;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

/**
 * @description: 栈的简单测试用例
 * @author: peikunkun
 * @create: 2020-01-03 16:42
 **/
@Slf4j
public class StackInterSimpleTests {


  @Test
  public void Administrator_86_20200103162132() {
    System.out.println("欢迎使用单元测试方法【Administrator_86()_20200103162132】");
    System.out.println("此方法测试描述：【栈的数组简单实现】");
    StackArray stackArray = new StackArray();
    System.out.println("栈内指针情况:" + stackArray.isEmpty());
    try {
      stackArray.pop();
    } catch (Exception e) {
      log.error("->", e);
    }
    stackArray.push("1");
    stackArray.push("2");

    System.out.println("弹栈:" + stackArray.pop());
    System.out.println("弹栈:" + stackArray.pop());
    System.out.println("栈内指针情况:" + stackArray.isEmpty());
    stackArray.push("1");
    System.out.println("栈内指针情况:" + stackArray.isEmpty());
    stackArray.push("2");
    stackArray.push("3");
    System.out.println("栈顶值为" + stackArray.peek());
  }


  @Test
  public void Administrator_42_20200103164358() {
    System.out.println("欢迎使用单元测试方法【Administrator_42()_20200103164358】");
    System.out.println("此方法测试描述：【栈的list数组容器简单实现】");
    StackInter stack = new StackDockerList();
    System.out.println("栈内指针情况:" + stack.isEmpty());
    try {
      stack.pop();
    } catch (Exception e) {
      log.error("->", e);
    }
    stack.push("1");
    stack.push("2");

    System.out.println("弹栈:" + stack.pop());
    System.out.println("弹栈:" + stack.pop());
    System.out.println("栈内指针情况:" + stack.isEmpty());
    stack.push("1");
    System.out.println("栈内指针情况:" + stack.isEmpty());
    stack.push("2");
    stack.push("3");
    System.out.println("栈顶值为" + stack.peek());
  }


  @Test
  public void Administrator_69_20200103173056() {
    System.out.println("欢迎使用单元测试方法【Administrator_69()_20200103173056】");
    System.out.println("此方法测试描述：【栈的链表式数组容器简单实现】");
    StackInter stack = new SinglyLinkedListStack();
    System.out.println("栈内指针情况:" + stack.isEmpty());
    try {
      stack.pop();
    } catch (Exception e) {
      log.error("->", e);
    }
    stack.push("1");
    stack.push("2");

    System.out.println("弹栈:" + stack.pop());
    System.out.println("弹栈:" + stack.pop());
    System.out.println("栈内指针情况:" + stack.isEmpty());
    stack.push("1");
    System.out.println("栈内指针情况:" + stack.isEmpty());
    stack.push("2");
    stack.push("3");
    System.out.println("栈顶值为" + stack.peek());
  }


}
